<template>
	<view class="box">
		<view class="input">
			<u--textarea v-model="content" placeholder="请具体描述您的意见或使用中碰到的问题" height="160" count></u--textarea>
		</view>
		<MButton name="提交" @click="submit" colorType="topic"></MButton>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	import {
		userInfoFeedback
	} from '../../api/my/index.js'
	export default {
		data() {
			return {
				content: '',
			}
		},
		methods: {
			async submit() {
				if (this.content.length == "") {
					this.$refs.uToast.show({
						message: '还没有填写意见反馈哦',
						type: 'error'
					})
					return
				}
				const res = await userInfoFeedback({
					feedbackType: "其他",
					content: this.content,
					imgUrl: ""
				})
				if (res.data.code == 200){
				  this.$refs.uToast.show({
				  	message:'提交成功',
				  	type: 'success'
				  })
				    setTimeout(()=>{
						uni.navigateBack(-1)
					},1000)
				}
				// uni.reLaunch({
				// 	url: './index',
				// 	animationType: this.animation.type,
				// 	animationDuration: this.animation.time
				// })
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "~@/styles/global.scss";

	.box {
		background-color: $pagebgc;
		width: 100%;
		height: 100vh;
		box-sizing: border-box;
		padding: 30rpx;

		.input {
			background-color: '#fff';
			margin-bottom: 40rpx;
		}
	}
</style>